// 初始化Echarts对象
var mCharts = echarts.init(document.querySelector('.line'));
// var xdata = ['2019.10.12', '2019.10.17', '2019.10.22', '2019.10.27', '2019.11.01', '2019.11.06'];
var option;
option = {
    tooltip: {
        trigger: 'axis',
    },
    xAxis: {
        axisLabel: {
            interval: 0,
            textStyle: {
                //textStyle里面写x轴下的字体的样式
                color: '#41454D',
                fontSize: 8,
                fontFamily: 'Microsoft YaHei',
                fontweight: 400,
            }
        },
        axisLine: {
            show: true,
            lineStyle: {
                color: '#C2C5CC',
                width: 1,
            }
        },
        // 是否显示坐标轴刻度。
        axisTick: {
            show: false
        },
        type: 'category',
        data: [
            '2019.10.12',
            '2019.10.17',
            '2019.10.22',
            '2019.10.27',
            '2019.11.01',
            '2019.11.06'
        ]
    },
    yAxis: {
        type: 'value',
        splitLine: { show: false },
        axisLine: {
            show: true,
            lineStyle: {
                color: '#C2C5CC',
                width: 1,
            }
        },
        axisLabel: {
            textStyle: {   //textStyle里面写x轴下的字体的样式
                color: '#41454D',
                fontSize: 7,
                fontFamily: 'Microsoft YaHei',
                fontweight: 400,
            }
        },
    },
    series: [
        {
            symbol: "none",
            type: 'line',
            smooth: true,
            lineStyle: {
                color: '#86C4F2'
            },
            data: [4.2, 2.5, 4.8, 1.2, 3.8, 6.2]
        },
        {
            symbol: "none",
            type: 'line',
            smooth: true,
            lineStyle: {
                color: '#9DC95A'
            },
            data: [6.2, 10.5, 5.3, 7.2, 8.4, 5.1]
        }
    ],
    grid: {
        left: 44,
        bottom: 53,
        right: 30,
        top: 26
    }
};
//将配置项设置给ECharts实例对象
mCharts.setOption(option);